package secret

import (
	"gitee/yinlai/kms-backend/controllers/secret"
	"github.com/gin-gonic/gin"
)

// 实现添加集群
func create(secretGroup *gin.RouterGroup) {
	secretGroup.POST("/create", secret.Create)
}

// 更新集群
func update(secretGroup *gin.RouterGroup) {
	secretGroup.POST("/update", secret.Update)
}

// 删除
func delete(secretGroup *gin.RouterGroup) {
	secretGroup.POST("/delete", secret.Delete)
}

// 删除列表
func deleteList(secretGroup *gin.RouterGroup) {
	secretGroup.POST("/deleteList", secret.DeleteList)
}

// 获取
func get(secretGroup *gin.RouterGroup) {
	secretGroup.GET("/get", secret.Get)
}

// 获取集群列表
func list(secretGroup *gin.RouterGroup) {
	secretGroup.GET("/list", secret.List)
}

func RegisterSubRouter(g *gin.RouterGroup) {
	secretGroup := g.Group("/secret")
	create(secretGroup)
	update(secretGroup)
	delete(secretGroup)
	get(secretGroup)
	list(secretGroup)
	deleteList(secretGroup)
}
